# coding=utf-8
words = str(input())
word = str(input())
words = words.lower()
word = word.lower()
print(words.count(word))